<template>
  <a-radio-button
    v-model:checked="check"
    :disabled="disabled"
    :autofocus="autofocus"
    :value="value"
  >
    <slot />
  </a-radio-button>
</template>
<script>
import { defineComponent, computed } from 'vue'
import { RadioButton } from 'ant-design-vue'
export default defineComponent({
  name: 'ZRadioButton',
  components: {
    ARadioButton: RadioButton
  },
  props: {
    value: {
      default: '',
      type: String
    },
    checked: Boolean,
    disabled: Boolean,
    autofocus: Boolean
  },
  setup(props, _ref) {
    const check = computed({
      get() {
        return props.checked
      },
      set(val) {
        _ref.emit('update:checked', val)
      }
    })
    return {
      check
    }
  }
})
</script>
